#ifndef _NUMTOOL_H_
#define _NUMTOOL_H_

#include "Vec.h"

template<int Dim>
inline bool equal(const Vec<double,Dim>& a, const Vec<double,Dim>& b, const double tol = 1e-16){
  if (norm((b-a),2) < tol)
    return 1;
  return 0;
}

inline bool equal(const double& a, const double& b, const double tol = 1e-16){
  if (fabs(b-a) < tol)
    return 1;
  return 0;
}

inline constexpr int factorial(int n){
  int r = 1;
  for (; n > 1 ; n--)
    r *= n;
  return r;
}
















#endif // _NUMTOOL_H_
